//recursion version  Tower of Hanoi
//////////////////////////////////////
#include <stdio.h>

void Hanoi(int n,char A,char C,char B)
{
    if(n == 1)
    {
        printf("1.%c -> %c\n",A,C);
    }
    else
    {
        Hanoi(n-1,A,B,C);
        printf("2.%c -> %c\n",A,C);
        Hanoi(n-1,B,C,A);
        //printf("%c -> %c\n",B,C);
    }
}

int main()
{
    int n = 0;
    printf("input:");
    scanf("%d",&n);
    Hanoi(n,'A','C','B');
    return 0;
}
